package com.t4.process.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.t4.auth.service.SysUserService;
import com.t4.model.process.ProcessRecord;
import com.t4.process.mapper.ProcessRecordMapper;
import com.t4.process.service.ProcessRecordService;
import com.t4.security.custom.LoginUserInfoHelper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class ProcessRecordServiceImpl extends ServiceImpl<ProcessRecordMapper, ProcessRecord> implements ProcessRecordService {

    @Resource
    private SysUserService sysUserService;

    @Override
    public void record(Long processId, Integer status, String description) {
        ProcessRecord processRecord = new ProcessRecord();
        processRecord.setProcessId(processId);
        processRecord.setStatus(status);
        processRecord.setDescription(description);
        processRecord.setOperateUserId(LoginUserInfoHelper.getUserId());
        processRecord.setOperateUser(LoginUserInfoHelper.getUsername());
        baseMapper.insert(processRecord);
    }
}
